<style>
    #article_container{
        width: 100%;
    }
    .tag-org{
        background-color: #FF9800 !important;
    }
</style>
<h3>历史文章管理</h3>
<div id="article_container">
    <div class="x_panel">
        <div class="x_title">
            <div class="history-toobar row form-inline">
                <div class="input-group col-md-3">
                    <span class="input-group-btn">
                        <button type="button" id="query" class="btn btn-primary">查询</button>
                    </span>
                    <input type="text" class="form-control" id="title" placeholder="文章标题">
                </div>
                <div class="col-md-3 input-group">
                    <div class="btn-group">
                        <button class="btn btn-primary statubtn">文章状态</button>
                        <button class="btn btn-default statubtn" value="pub" type="button">已发布</button>
                        <button class="btn btn-default statubtn" value="nopub" type="button">未发布</button>
                        <button class="btn btn-default statubtn" value="del" type="button">已删除</button>
                    </div>
                </div>
                <div class="x_content">
                    <table class="table">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>标题</th>
                            <th>简介</th>
                            <th>访问地址</th>
                            <th>类别</th>
                            <th>标签</th>
                            <th>允许评论</th>
                            <th>状态</th>
                            <th>编辑</th>
                        </tr>
                        </thead>
                        <tbody>
                        <% for (article in articles!){ %>
                        <tr>
                            <th scope="row">${ articleLP.index! }</th>
                            <th hidden>${ article.id! }</th>
                            <td class="art-title">${ article.title!}</td>
                            <td style="max-width: 300px;">${ article.excerpt! }</td>
                            <td>${ article.subpath! }</td>
                            <td><span class="tag">${ article.categories! }</span></td>
                            <%
                            if(strutil.length(article.tags)>0){
                            article.tags = strutil.replace(article.tags,",","</span><span class='tag tag-org'>");
                            article.tags = "<span class='tag tag-org'>"+article.tags+"</span>";
                        }
                    %>
                        <td>${ article.tags! }</td>
                        <%
                            var commClass = "fa-close";
                            if(article.usecommont=="on"){
                                commClass = "fa-check";
                            }
                        %>
                        <td><span class="fa ${commClass}"></span></td>
                        <%
                            var class = "label-info";
                            if(article.flag==9){
                                class = "label-danger";
                            }else if(article.flag==1){
                                class = "label-success";
                            }
                        %>
                        <td><span class="statu label ${class}" value="${article.flag!}">${ session.stateDic[article.flag+""]! }</span></td>
                        <%
                            var disabled = "";
                            if(article.flag==1){
                                disabled = "disabled";
                            }
                        %>
                        <td>
                            <button value="${article.id}" ${disabled}
                                    class="btn btn-sm btn-default btn-publish">发布</button>
                            <button value="${article.id}" class="btn btn-sm btn-primary btn-edit">编辑</button>
                            <button value="${article.id}" class="btn btn-sm btn-danger btn-delete">删除</button>
                            <button value="${article.id}" class="btn btn-sm btn-success btn-show">预览</button>
                        </td>
                    </span></tr>
                        <% } %>
                        </tbody>
                    </table>
                    <div class="page">

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>